<nz-drawer [nzClosable]="false" [nzVisible]="visible" nzPlacement="right" nzWidth="25%" nzTitle="菜单"
           [nzFooter]="footerTpl"
           (nzOnClose)="close()">
  <form nz-form [formGroup]="validateForm" nzLayout="vertical" (ngSubmit)="submitForm()">
    <nz-form-item>
      <nz-form-control [nzXs]="24" nzErrorTip="The input is not valid E-mail!">
        <label for="parentId">父级菜单</label>
        <br/>
        <nz-tree-select
          nzSize="small"
          id="parentId"
          formControlName="parentId"
          style="width: 250px"
          [nzNodes]="nodes"
          nzShowSearch
          nzPlaceHolder="Please select"
          [(ngModel)]="value"
        >
        </nz-tree-select>

      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-control [nzXs]="24" nzErrorTip="Please input your password!">
        <label for="menuCode">菜单编号</label><input nzSize="small" nz-input id="menuCode" formControlName="menuCode"/>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-control [nzXs]="24">
        <label for="menuName">菜单名称</label><input nzSize="small" nz-input formControlName="menuName" id="menuName"/>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-control [nzXs]="24" nzErrorTip="Please input your icon!">
        <label for="icon">图标</label><input nzSize="small" nz-input id="icon" formControlName="icon"/>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-control
        [nzValidateStatus]="validateForm.controls['url']"
        nzErrorTip="Please input your phone url!"
      >
        <label for="url">路由</label><input nzSize="small" nz-input id="url" formControlName="url"/>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-control [nzXs]="24" nzErrorTip="Please input your idx!">
        <label for="idx">排序号</label><input nzSize="small" nz-input id="idx" formControlName="idx"/>
      </nz-form-control>
    </nz-form-item>

  </form>

  <ng-template #footerTpl>
    <div style="float: right">
      <button nz-button style="margin-right: 8px;" (click)="close()">取消</button>
      <button nz-button nzType="primary" (click)="submitForm()">保存</button>
    </div>
  </ng-template>

</nz-drawer>
